package chamans{
	import flash.display.*;
	import flash.events.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;
	
	public class PlayerError extends Sprite
	{
		public function PlayerError(base:Object, V:String, icon:MovieClip=null ) : void
		{
			version=V;
			BASE=base;
			BASE.SYS.OUT("Flash player error !");
			back=new Sprite(); this.addChild(back);
			center=new Sprite(); this.addChild(center);
			var CC:Shape=BASE.TOOL.BGstripe();
			bgim = BASE.TOOL.bit(CC, 64,64);
			bg = new Shape(); back.addChild(bg); 
			bg.alpha=1;
			center.addChild(icon); icon.x=-32; icon.y=-60;
			icon.gotoAndStop(2);
			add_Message();
			Resize();
		}
		private function add_Message():void
		{  
			var message:XML=
				<xml><errorplug>Sorry plug-ins error, bad version </errorplug>
				<errorplug2><a href="event:INCUBATOR">Get player INCUBATOR beta 11.0.1.3d</a></errorplug2>
				<errorplug3></errorplug3></xml>;
			message.errorplug3="Current version : "+ version;	
			var MessageText:SYS_text=new SYS_text(BASE.SYS.FONT.CSS, 300,-150);
			center.addChild(MessageText)
			MessageText.readXML(message, LinkAction )
		}
		private function LinkAction (t:String):void
		{
			switch (t){
				case "INCUBATOR": 
					navigateToURL ( new URLRequest( 'http://labs.adobe.com/downloads/flashplatformruntimes_incubator.html' ) ,"_blank" );
					break; 
			}}
		public function Resize(e:Event=null):void
		{
			var w:int=BASE.stage.stageWidth;
			var h:int=BASE.stage.stageHeight;
			BASE.TOOL.drawbg( bg, bgim, new Matrix(), w,h-130, 0, 65 );
			center.x=w>>1; center.y=h>>1;
		}
		
		private var BASE:Object
		private var version:String
		private var logo:Sprite
		private var back:Sprite
		private var center:Sprite
		private var bg:Shape
		private var bgim:BitmapData
	}}